package com.ucode.cgms.mapper;

import com.ucode.model.cgms.CgmsCompanionProduct;
import com.ucode.springboot.starter.mybatis.core.base.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.Collection;

/**
 * 陪玩服务商品
 * @Author: liliang
 * @Date: 2025/5/9 18:08
 * @Version: 1.0
 */
@Mapper
public interface CgmsCompanionProductMapper extends BaseMapper<CgmsCompanionProduct,  Long> {

    /**
     * 变更状态
     * @param ids
     * @param status
     * @param releaseTime
     * @return
     */
    public int updateStatus(@Param("ids") Collection<Long> ids , @Param("status")Integer status, @Param("releaseTime") LocalDateTime releaseTime);

    /**
     * 增量增加销量，同步增量减少库存
     * @param id
     * @param decrStockCount 正数
     * @return
     */
    public int updateIncrSalesAndDecrStock(@Param("id")Long id,@Param("decrStockCount")Integer decrStockCount);
    /**
     * 增量减少销量，同步增量增加库存
     * @param id
     * @param incrStockCount 正数
     * @return
     */
    public int updateDecrSalesAndIncrStock(@Param("id")Long id,@Param("incrStockCount")Integer incrStockCount);

}
